Skip to content

[NPU]: Adjust MAX_FUSED_SIZE when using fused_linear_cross_entropy#985

Merged
lancerts merged 3 commits intolinkedin:mainfrom
zheliuyu:main
Dec 23, 2025
Merged

[NPU]: Adjust MAX_FUSED_SIZE when using fused_linear_cross_entropy#985
lancerts merged 3 commits intolinkedin:mainfrom
zheliuyu:main

Conversation

@zheliuyu
Copy link
Copy Markdown
Contributor

@zheliuyu zheliuyu commented Dec 23, 2025

Summary

Adjust MAX_FUSED_SIZE to avoid ub overflow when using fused_linear_cross_entropy on npu.

Testing Done

  • Hardware Type: Ascend NPU A2
  • run make test to ensure correctness
  • run make checkstyle to ensure code style
  • run make test-convergence to ensure convergence

Compare

pytest test/transformers/test_fused_linear_cross_entropy.py

Original code: 105 passed, 16 failed. All failed due to ub overflow.

Adjusted: 121 passed

@zheliuyu zheliuyu marked this pull request as ready for review December 23, 2025 09:31
@zheliuyu zheliuyu changed the title Adjust MAX_FUSED_SIZE when using fused_linear_cross_entropy [NPU]: Adjust MAX_FUSED_SIZE when using fused_linear_cross_entropy Dec 23, 2025
@lancerts lancerts merged commit 44c2c31 into linkedin:main Dec 23, 2025
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants